package offer;

public class ReplaceSpace_05 {
    public String replaceSpace(String s) {
        StringBuilder sb = new StringBuilder();
        String[] s1 = s.split(" ");
        for (String s2 : s1) {
            sb.append(s2).append("%");
        }
        return sb.subSequence(0,s.length() - 1).toString();

    }
}
